# -*- coding: utf-8 -*-
# @Time    :2022/1/7 22:36
# @AUTHOR  :MORAN
# @Email   :moran@maqu.com
# @File    :urls.py
# @Software:PyCharm
from django.urls import path
from .views import StudentViewSet, DepartmentViewSet
from rest_framework.routers import SimpleRouter

urlpatterns = [
    # path('students/', StudentViewSet.as_view({'get': 'list', 'post': 'create'})),
    # path('students/<pk>/', StudentViewSet.as_view({'get': 'retrieve', 'put': 'update', 'delete': 'destory'}))
]
router = SimpleRouter()  # 创建路由器
router.register('students', StudentViewSet)  # 注册路由
router.register('departments', DepartmentViewSet)  # 注册路由
urlpatterns += router.urls  # 拼接路由
